package com.kogi.androidpatterns.screenInteractions.moveContent;


import com.kogi.patterns.R;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;

public class imageAdapterCouples extends BaseAdapter 
{
    private Context mContext;

    public imageAdapterCouples(Context c) 
    {
        mContext = c;
    }

    public int getCount() 
    {
        return mThumbIds.length;
    }

    public Object getItem(int position) 
    {
        return null;
    }

    public long getItemId(int position) 
    {
        return 0;
    }

    // create a new ImageView for each item referenced by the Adapter
    public View getView(int position, View convertView, ViewGroup parent) 
    {
        ImageView imageView;
        if (convertView == null) 
        {  // if it's not recycled, initialize some attributes
            imageView = new ImageView(mContext);
            imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
            imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
            imageView.setPadding(8, 8, 8, 8);
        } 
        else 
        {
            imageView = (ImageView) convertView;
        }
        imageView.setImageResource(mThumbIds[position]);
        return imageView;
    }

    // references to our images
    private Integer[] mThumbIds =
    {
            R.drawable.couple11, R.drawable.couple12,
            R.drawable.couple21, R.drawable.couple22,
            R.drawable.couple31, R.drawable.couple32,
            R.drawable.couple41, R.drawable.couple42,
            R.drawable.couple51, R.drawable.couple52,
            R.drawable.couple61, R.drawable.couple62,

    };
}
